package com.java1412.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2023-10-29 15:09:41
 */
@RestController
public class HelloController {
    @Resource
    private RestTemplate restTemplate;

//    @RequestMapping(value = "/hi")
//    public String home() {
//        System.out.println("home");
//        return "hi i'm miya!";
//    }

    @RequestMapping(value = "/miya")
    public String info() {
        System.out.println("info");
        return restTemplate.getForObject("http://localhost:8988/info", String.class);
    }
}
